* This script contains the code to select the best model according to BIC for the analysis in Table A6 of the on-line appendix in Ductor, L., Fafchamps, M., Goyal S. and M. van der Leij. Social Networks and Research Output. The Review of Economics and Statistics.

log using modelselection_fs_prod5.log, replace
use prodndnp_fullsample.dta, clear

tsset auth year, yearly
gen lprodf5l=log(prod+L.prod+L2.prod+L3.prod+L4.prod+1)
gen lprodf5l2=L.lprodf5l
gen lprodf5l3=L2.lprodf5l
gen lprodf5l4=L3.lprodf5l
gen lprodf5l5=L4.lprodf5l
gen lprodf5l6=L5.lprodf5l
gen lprodf5l7=L6.lprodf5l
gen lprodf5l8=L7.lprodf5l
gen lprodf5l9=L8.lprodf5l
gen lprodf5l10=L9.lprodf5l
gen lprodf5l11=L10.lprodf5l
gen lprodf5l12=L11.lprodf5l
gen lprodf5l13=L12.lprodf5l
gen lprodf5l14=L13.lprodf5l
gen lprodf5l15=L14.lprodf5l
gen lprodf5l16=L15.lprodf5l


/*Replacing missing by zeros*/

/*Creating log(x+1) variables*/
foreach i in 1y 2y 3y 4y 5y 6y 7y 8y 9y 10y 11y 12y 13y 14y 15y{
replace lclos`i'=0 if missing(lclos`i') 
replace lbet`i'=0 if missing(lbet`i') 
replace lnetprod`i'=0 if missing(lnetprod`i')
replace lnetprod2`i'=0 if missing(lnetprod2`i') 
replace degree`i'=0 if missing(degree`i')
replace degree2`i'=0 if missing(degree2`i') 
replace neiq1`i'=0 if missing(neiq1`i')
replace gc`i'=0 if missing(gc`i')
}
foreach i in lprodf5l lprodf5l2 lprodf5l3 lprodf5l4 lprodf5l5 lprodf5l6 lprodf5l7 lprodf5l8 lprodf5l9 lprodf5l10 lprodf5l11 lprodf5l12 lprodf5l13 lprodf5l14 lprodf5l15 lprodf5l16{
replace `i'=0 if missing(`i')
}

order auth year t tsq lcprod5 lcprodl5 lprodf5 lprodf5l-lprodf5l16 prod prodf5 qnt cprod cprod5 cprodl5 mnauthors ystart yend nopapers group prodf3 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y degree15y degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y degree215y gc1y gc2y gc3y gc4y gc5y gc6y gc7y gc8y gc9y gc10y gc11y gc12y gc13y gc14y gc15y lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y lnetprod13y lnetprod14y lnetprod15y lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y lnetprod213y lnetprod214y lnetprod215y lbet1y lbet2y lbet3y lbet4y lbet5y lbet6y lbet7y lbet8y lbet9y lbet10y lbet11y lbet12y lbet13y lbet14y lbet15y

tab year, g(y)

sort auth year
foreach i in 17 18 19 20 21 22 23 24 25 26 27{
gen lprodf5l`i'=L`i-1'.lprodf5l
replace lprodf5l`i'=0 if missing(lprodf5l`i')
}

/*OLS out-of-sample program*/
cap pro drop ols_os
program define ols_os
syntax varlist(numeric min=1) [if]
marksample touse
quietly reg `varlist' if `touse', vce(cluster auth)
qui scalar n1=e(N)
estat ic
scalar rmseols=e(rmse)
predict ybols if group==2, xb 
scalar r2i1ols= e(r2)   /*computing the R2 of the baseline model*/
qui gen sqerrols= (lprodf5-ybols)^2 if ybols<.
quietly egen peols=sum(sqerrols)if ybols<.  /*RSEE of the predicted model*/
quietly sum peols    /*summarizing the RSEE*/
quietly scalar rssols=r(max)  /*obtaining the total RSEE*/
quietly scalar nols=r(N)    /*number of observations in group 2*/
scalar rmseo2ols=(rssols/(nols-(e(df_m)+2)))^0.5   /*RMSE out of sample*/
di rmseols   "  Pooled OLS in-sample RMSE"
di n1 " Number of observations in the in-sample group"
di rmseo2ols "  Pooled OLS out-of-sample RMSE"
di nols " Number of observations in the out-of-sample group"
drop sqerrols peols ybols
end

/*Selecting the maximun lag length*/

order auth year t tsq lcprod5 lcprodl5 lprodf5 lprodf5l*
tab year, g(t)

ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l24 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l23 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l22 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l21 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l20 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l19 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l18 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l17 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l16 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l15 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l14 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l13 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l12 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l10 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l9 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l8 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l7 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l6 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l5 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l4 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l3 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l2 if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l if group==1


/*Comparing the best unrestricted model with the previous Model 1*/
foreach i in lcprod5 lcprodl5{
replace `i'=0 if missing(`i')
}

ols_os lprodf5 y2-y25 nopapers t2-t25 lcprodl5 lcprod5 if group==1
estat ic 

set more off
/*The best model in terms of BIC and RMSE out-of-sample contains 11 lags*/

/************************NEW MODELS 3: INCLUDE OUTPUT AND A NETWORK VARIABLE***********************/
/*Netprod*/

ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y lnetprod13y lnetprod14y lnetprod15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y lnetprod13y lnetprod14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y lnetprod13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y lnetprod4y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y lnetprod3y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y lnetprod2y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y if group==1

/*lag 7 best model*/

/*Netprod2*/
set more off
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y lnetprod213y lnetprod214y lnetprod215y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y lnetprod213y lnetprod214y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y lnetprod213y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y lnetprod24y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y lnetprod23y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y lnetprod22y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod21y if group==1
/*Best model: 15 lags*/

/*Degree*/

set more off
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y degree15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y degree7y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y degree6y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y degree5y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y degree4y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y degree3y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y degree2y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree1y if group==1

/*Best model: lag 15*/
 
/*Degree 2*/

set more off
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y degree215y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y degree27y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y degree26y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y degree25y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y degree24y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y degree23y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y degree22y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 degree21y if group==1

/*Best model: 15 lags*/

set more off
/*Giant Component*/
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc14y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc13y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc12y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc11y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc10y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc9y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc8y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc7y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc6y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc5y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc4y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc3y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y  if group==1

/*Best model: 15 lags*/

set more off
/*Betweenness*/
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc15y lbet1y-lbet15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc14y lbet1y-lbet14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc13y  lbet1y-lbet13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc12y  lbet1y-lbet12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc11y lbet1y-lbet11y   if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc10y lbet1y-lbet10y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc9y lbet1y-lbet9y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc8y lbet1y-lbet8y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc7y lbet1y-lbet7y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc6y lbet1y-lbet6y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc5y lbet1y-lbet5y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc4y lbet1y-lbet4y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc3y lbet1y-lbet3y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y lbet1y lbet2y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y lbet1y if group==1

/*Best model: 15 lags*/

set more off
/*closenness*/
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc15y lclos1y-lclos15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc14y lclos1y-lclos14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc13y  lclos1y-lclos13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc12y  lclos1y-lclos12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc11y lclos1y-lclos11y   if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc10y lclos1y-lclos10y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc9y lclos1y-lclos9y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc8y lclos1y-lclos8y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc7y lclos1y-lclos7y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc6y lclos1y-lclos6y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc5y lclos1y-lclos5y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc4y lclos1y-lclos4y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y-gc3y lclos1y-lclos3y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y gc2y lclos1y lclos2y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 gc1y lclos1y if group==1
/*Best model: 15 lags*/

/*neiq1*/
set more off
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y neiq113y neiq114y neiq115y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y neiq113y neiq114y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y neiq113y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y neiq15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y neiq14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y neiq13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y neiq12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 neiq11y if group==1
/*Best model: 9lags*/

/************************NEW MODELS 2: BASELINE MODEL + A NETWORK VARIABLE***********************/
/*Netprod*/

ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y lnetprod13y lnetprod14y lnetprod15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y lnetprod13y lnetprod14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y lnetprod13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y lnetprod12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y lnetprod11y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y lnetprod10y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y lnetprod9y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y lnetprod8y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y lnetprod7y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y lnetprod6y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y lnetprod5y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y lnetprod4y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y lnetprod3y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y lnetprod2y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod1y if group==1
/*13y lowest BIC*/

/*Netprod2*/

ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y lnetprod213y lnetprod214y lnetprod215y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y lnetprod213y lnetprod214y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y lnetprod213y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y lnetprod212y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y lnetprod211y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y lnetprod210y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y lnetprod29y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y lnetprod28y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y lnetprod27y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y lnetprod26y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y lnetprod25y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y lnetprod24y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y lnetprod23y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y lnetprod22y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  lnetprod21y if group==1
/* 12y lowest BIC*/

/*Degree*/

ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y degree15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y degree7y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y degree6y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y degree5y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y degree4y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y degree3y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y degree2y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree1y if group==1
/* 13y lowest BIC*/


/*Degree 2*/


ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y degree215y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y degree27y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y degree26y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y degree25y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y degree24y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y degree23y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y degree22y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  degree21y if group==1
/* 13y lowest BIC*/


/*Giant Component*/
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc14y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc13y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc12y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc11y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc10y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc9y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc8y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc7y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc6y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc5y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc4y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc3y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y  if group==1
/* 15y lowest BIC*/

/*Betweenness*/
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc15y lbet1y-lbet15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc14y lbet1y-lbet14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc13y  lbet1y-lbet13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc12y  lbet1y-lbet12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc11y lbet1y-lbet11y   if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc10y lbet1y-lbet10y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc9y lbet1y-lbet9y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc8y lbet1y-lbet8y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc7y lbet1y-lbet7y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc6y lbet1y-lbet6y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc5y lbet1y-lbet5y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc4y lbet1y-lbet4y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc3y lbet1y-lbet3y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y lbet1y lbet2y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y lbet1y if group==1
/* 12y lowest BIC*/

/*closenness*/
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc15y lclos1y-lclos15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc14y lclos1y-lclos14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc13y  lclos1y-lclos13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc12y  lclos1y-lclos12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc11y lclos1y-lclos11y   if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc10y lclos1y-lclos10y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc9y lclos1y-lclos9y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc8y lclos1y-lclos8y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc7y lclos1y-lclos7y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc6y lclos1y-lclos6y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc5y lclos1y-lclos5y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc4y lclos1y-lclos4y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y-gc3y lclos1y-lclos3y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y gc2y lclos1y lclos2y  if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  gc1y lclos1y if group==1
/* 15y lowest BIC*/

/*neiq1*/

ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y neiq113y neiq114y neiq115y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y neiq113y neiq114y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y neiq113y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y neiq112y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y neiq111y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y neiq110y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y neiq19y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y neiq18y if group==1 
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y neiq17y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y neiq16y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y neiq15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y neiq14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y neiq13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y neiq12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25  neiq11y if group==1
/* 14y lowest BIC*/

/************************Multivariate Model 2: INCLUDE All THE RELEVANT NETWORK VARIABLES***********************/

/*Stepwise*/

ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod15y lnetprod21y-lnetprod215y degree1y-degree15y degree21y-degree215y gc1y-gc15y lbet1y-lbet15y lclos1y-lclos15y neiq11y-neiq115y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod14y lnetprod21y-lnetprod214y degree1y-degree14y degree21y-degree214y gc1y-gc14y lbet1y-lbet14y lclos1y-lclos14y neiq11y-neiq114y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod13y lnetprod21y-lnetprod213y degree1y-degree13y degree21y-degree213y gc1y-gc13y lbet1y-lbet13y lclos1y-lclos13y neiq11y-neiq113y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod12y lnetprod21y-lnetprod212y degree1y-degree12y degree21y-degree212y gc1y-gc12y lbet1y-lbet12y lclos1y-lclos12y neiq11y-neiq112y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod11y lnetprod21y-lnetprod211y degree1y-degree11y degree21y-degree211y gc1y-gc11y lbet1y-lbet11y lclos1y-lclos11y neiq11y-neiq111y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod10y lnetprod21y-lnetprod210y degree1y-degree10y degree21y-degree210y gc1y-gc10y lbet1y-lbet10y lclos1y-lclos10y neiq11y-neiq110y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod9y lnetprod21y-lnetprod29y degree1y-degree9y degree21y-degree29y gc1y-gc9y lbet1y-lbet9y lclos1y-lclos9y neiq11y-neiq19y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod8y lnetprod21y-lnetprod28y degree1y-degree8y degree21y-degree28y gc1y-gc8y lbet1y-lbet8y lclos1y-lclos8y neiq11y-neiq18y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod7y lnetprod21y-lnetprod27y degree1y-degree7y degree21y-degree27y gc1y-gc7y lbet1y-lbet7y lclos1y-lclos7y neiq11y-neiq17y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod6y lnetprod21y-lnetprod26y degree1y-degree6y degree21y-degree26y gc1y-gc6y lbet1y-lbet6y lclos1y-lclos6y neiq11y-neiq16y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lnetprod1y-lnetprod5y lnetprod21y-lnetprod25y degree1y-degree5y degree21y-degree25y gc1y-gc5y lbet1y-lbet5y lclos1y-lclos5y neiq11y-neiq15y if group==1


/*13lag, lowest BIC*/

/************************Multivariate Model 3: Past output+All THE RELEVANT NETWORK VARIABLES***********************/

/*Stepwise*/

ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod15y lnetprod21y-lnetprod215y degree1y-degree15y degree21y-degree215y gc1y-gc15y lbet1y-lbet15y lclos1y-lclos15y neiq11y-neiq115y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod14y lnetprod21y-lnetprod214y degree1y-degree14y degree21y-degree214y gc1y-gc14y lbet1y-lbet14y lclos1y-lclos14y neiq11y-neiq114y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod13y lnetprod21y-lnetprod213y degree1y-degree13y degree21y-degree213y gc1y-gc13y lbet1y-lbet13y lclos1y-lclos13y neiq11y-neiq113y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod12y lnetprod21y-lnetprod212y degree1y-degree12y degree21y-degree212y gc1y-gc12y lbet1y-lbet12y lclos1y-lclos12y neiq11y-neiq112y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod11y lnetprod21y-lnetprod211y degree1y-degree11y degree21y-degree211y gc1y-gc11y lbet1y-lbet11y lclos1y-lclos11y neiq11y-neiq111y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod10y lnetprod21y-lnetprod210y degree1y-degree10y degree21y-degree210y gc1y-gc10y lbet1y-lbet10y lclos1y-lclos10y neiq11y-neiq110y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod9y lnetprod21y-lnetprod29y degree1y-degree9y degree21y-degree29y gc1y-gc9y lbet1y-lbet9y lclos1y-lclos9y neiq11y-neiq19y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod8y lnetprod21y-lnetprod28y degree1y-degree8y degree21y-degree28y gc1y-gc8y lbet1y-lbet8y lclos1y-lclos8y neiq11y-neiq18y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod7y lnetprod21y-lnetprod27y degree1y-degree7y degree21y-degree27y gc1y-gc7y lbet1y-lbet7y lclos1y-lclos7y neiq11y-neiq17y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod6y lnetprod21y-lnetprod26y degree1y-degree6y degree21y-degree26y gc1y-gc6y lbet1y-lbet6y lclos1y-lclos6y neiq11y-neiq16y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod5y lnetprod21y-lnetprod25y degree1y-degree5y degree21y-degree25y gc1y-gc5y lbet1y-lbet5y lclos1y-lclos5y neiq11y-neiq15y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod4y lnetprod21y-lnetprod24y degree1y-degree4y degree21y-degree24y gc1y-gc4y lbet1y-lbet4y lclos1y-lclos4y neiq11y-neiq14y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod3y lnetprod21y-lnetprod23y degree1y-degree3y degree21y-degree23y gc1y-gc3y lbet1y-lbet3y lclos1y-lclos3y neiq11y-neiq13y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod2y lnetprod21y-lnetprod22y degree1y-degree2y degree21y-degree22y gc1y-gc2y lbet1y-lbet2y lclos1y-lclos2y neiq11y-neiq12y if group==1
ols_os lprodf5 y2-y25 nopapers t2-t25 lprodf5l-lprodf5l11 lnetprod1y-lnetprod1y lnetprod21y-lnetprod21y degree1y-degree1y degree21y-degree21y gc1y-gc1y lbet1y-lbet1y lclos1y-lclos1y neiq11y-neiq11y if group==1

/*9 lag, lowest BIC*/

log close
